{% extends 'commonTmp.html' %}
{% block main %}

    <!--====================================================================
        Start Banner Section
    =====================================================================-->
    <section class="banner-section" style="background-image:url({% static 'assets/img/banner.png' %});">
        <div class="container">
            <div class="banner-inner text-center">
                <h2 class="page-title">搜索结果</h2>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="{% url 'index' %}">首页</a></li>
                        <li class="breadcrumb-item active" aria-current="page"><a href="{% url 'shop' 1 1%}">商品</a></li>
                    </ol>
                </nav>
            </div>
        </div>
    </section>
    <!--====================================================================
        End Banner Section
    =====================================================================-->


    <!--====================================================================
       Start Shop Page
   =====================================================================-->
    <section class="blog-grid-section mt-120 rmt-80 mb-120 rmb-75">
        <div class="container">
            <div class="row col-gap-60">
                <div class="col-xl-9 col-lg-8">
                    <div class="row col-gap-60 blog-page">

                        <!-- single news Block -->
                        {% for gl in pager.object_list %}
                        <div class="col-md-6">
                            <div class="latest-news-box mb-30">
                                <div class="latest-news-img">
                                    <img src="{% static 'assets/img/goods/' %}{{gl.goods_img}}" alt="img" style="height: 250px !important;">
                                </div>
                                <div class="latest-news-content">
                                    <div class="post-title br-5">
                                        <span class="date">{{gl.goods_name}}</span>
                                    <h5><a href="blog-details.html">{{gl.goods_tips}}</a></h5>
                                    </div>
                                     <p>{{gl.goods_desc}}</p>
                                    <div class="blog-meta">
                                        <div class="blog-meta">
                                    <a href="{% url 'shopDetails' gl.id gl.goods_cag_id %} " class="theme-btn br-30 ml-20" style="color: #FFFFFF">加入购物车</a>
                                </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {% endfor %}
                    </div>


                 <!-- pagination -->

                  <nav class="properties-pazination mt-20 rmb-80">
                        {% if pager.has_previous %}
                            <a href="{% url 'search'   pager.previous_page_number  q %}">上一页</a>
                            {% else %}
                            <a href="{% url 'search'  pager.number q  %}">上一页</a>
                        {% endif %}
                                {% for i in pager.paginator.page_range %}
                                    {% if pager.number == i%}
                                         <li class="active"><a href="{% url 'search' i q %}">{{i}}</a></li>
                                            {% else %}
                                                <li><a href="{% url 'search'  i q %}"> {{ i }}</a></li>
                                    {% endif %}
                                {% endfor %}
                        {% if pager.has_next %}
                            <a href="{% url 'search'  pager.next_page_number q  %}">下一页</a>
                            {% else %}
                             <a href="{% url 'search'  pager.number q %}">下一页</a>
                        {% endif %}
                        <span>
                            共 {{ pager.paginator.num_pages }} 页

                        </span>

                 </nav>

                </div>

            </div>
        </div>
    </section>
 {% endblock %}


